<template>
  <div class="app-container">
    <!--    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">-->
    <!--      <el-form-item label="名称" prop="name">-->
    <!--        <el-input-->
    <!--          v-model="queryParams.name"-->
    <!--          placeholder="请输入名称"-->
    <!--          clearable-->
    <!--          @keyup.enter.native="handleQuery"-->
    <!--        />-->
    <!--      </el-form-item>-->
    <!--      <el-form-item label="工作描述" prop="job">-->
    <!--        <el-input-->
    <!--          v-model="queryParams.job"-->
    <!--          placeholder="请输入工作描述"-->
    <!--          clearable-->
    <!--          @keyup.enter.native="handleQuery"-->
    <!--        />-->
    <!--      </el-form-item>-->
    <!--      <el-form-item label="电话" prop="tel">-->
    <!--        <el-input-->
    <!--          v-model="queryParams.tel"-->
    <!--          placeholder="请输入电话"-->
    <!--          clearable-->
    <!--          @keyup.enter.native="handleQuery"-->
    <!--        />-->
    <!--      </el-form-item>-->
    <!--      <el-form-item label="版权信息" prop="banquan">-->
    <!--        <el-input-->
    <!--          v-model="queryParams.banquan"-->
    <!--          placeholder="请输入版权信息"-->
    <!--          clearable-->
    <!--          @keyup.enter.native="handleQuery"-->
    <!--        />-->
    <!--      </el-form-item>-->
    <!--      <el-form-item label="备案信息" prop="beian">-->
    <!--        <el-input-->
    <!--          v-model="queryParams.beian"-->
    <!--          placeholder="请输入备案信息"-->
    <!--          clearable-->
    <!--          @keyup.enter.native="handleQuery"-->
    <!--        />-->
    <!--      </el-form-item>-->
    <!--      <el-form-item label="杀号数量" prop="killcount">-->
    <!--        <el-input-->
    <!--          v-model="queryParams.killcount"-->
    <!--          placeholder="请输入杀号数量"-->
    <!--          clearable-->
    <!--          @keyup.enter.native="handleQuery"-->
    <!--        />-->
    <!--      </el-form-item>-->
    <!--      <el-form-item label="是否废弃" prop="abandoning">-->
    <!--        <el-input-->
    <!--          v-model="queryParams.abandoning"-->
    <!--          placeholder="请输入是否废弃"-->
    <!--          clearable-->
    <!--          @keyup.enter.native="handleQuery"-->
    <!--        />-->
    <!--      </el-form-item>-->
    <!--      <el-form-item label="订单超时时间" prop="orderovertime">-->
    <!--        <el-input-->
    <!--          v-model="queryParams.orderovertime"-->
    <!--          placeholder="请输入订单超时时间"-->
    <!--          clearable-->
    <!--          @keyup.enter.native="handleQuery"-->
    <!--        />-->
    <!--      </el-form-item>-->
    <!--      <el-form-item label="支付时间" prop="paytime">-->
    <!--        <el-input-->
    <!--          v-model="queryParams.paytime"-->
    <!--          placeholder="请输入支付时间"-->
    <!--          clearable-->
    <!--          @keyup.enter.native="handleQuery"-->
    <!--        />-->
    <!--      </el-form-item>-->
    <!--      <el-form-item label="休息天数" prop="xuiutian">-->
    <!--        <el-input-->
    <!--          v-model="queryParams.xuiutian"-->
    <!--          placeholder="请输入休息天数"-->
    <!--          clearable-->
    <!--          @keyup.enter.native="handleQuery"-->
    <!--        />-->
    <!--      </el-form-item>-->
    <!--      <el-form-item label="最小价格" prop="minprices">-->
    <!--        <el-input-->
    <!--          v-model="queryParams.minprices"-->
    <!--          placeholder="请输入最小价格"-->
    <!--          clearable-->
    <!--          @keyup.enter.native="handleQuery"-->
    <!--        />-->
    <!--      </el-form-item>-->
    <!--      <el-form-item label="最大价格" prop="maxprices">-->
    <!--        <el-input-->
    <!--          v-model="queryParams.maxprices"-->
    <!--          placeholder="请输入最大价格"-->
    <!--          clearable-->
    <!--          @keyup.enter.native="handleQuery"-->
    <!--        />-->
    <!--      </el-form-item>-->
    <!--      <el-form-item label="最小价格" prop="minprice">-->
    <!--        <el-input-->
    <!--          v-model="queryParams.minprice"-->
    <!--          placeholder="请输入最小价格"-->
    <!--          clearable-->
    <!--          @keyup.enter.native="handleQuery"-->
    <!--        />-->
    <!--      </el-form-item>-->
    <!--      <el-form-item label="最大价格" prop="maxprice">-->
    <!--        <el-input-->
    <!--          v-model="queryParams.maxprice"-->
    <!--          placeholder="请输入最大价格"-->
    <!--          clearable-->
    <!--          @keyup.enter.native="handleQuery"-->
    <!--        />-->
    <!--      </el-form-item>-->
    <!--      <el-form-item label="佣金阈值" prop="commissionThreshold">-->
    <!--        <el-input-->
    <!--          v-model="queryParams.commissionThreshold"-->
    <!--          placeholder="请输入佣金阈值"-->
    <!--          clearable-->
    <!--          @keyup.enter.native="handleQuery"-->
    <!--        />-->
    <!--      </el-form-item>-->
    <!--      <el-form-item label="用户优惠券" prop="usercoupons">-->
    <!--        <el-input-->
    <!--          v-model="queryParams.usercoupons"-->
    <!--          placeholder="请输入用户优惠券"-->
    <!--          clearable-->
    <!--          @keyup.enter.native="handleQuery"-->
    <!--        />-->
    <!--      </el-form-item>-->
    <!--      <el-form-item label="用户优惠券万" prop="usercouponswan">-->
    <!--        <el-input-->
    <!--          v-model="queryParams.usercouponswan"-->
    <!--          placeholder="请输入用户优惠券万"-->
    <!--          clearable-->
    <!--          @keyup.enter.native="handleQuery"-->
    <!--        />-->
    <!--      </el-form-item>-->
    <!--      <el-form-item label="店铺绑定ID" prop="storebangdingid">-->
    <!--        <el-input-->
    <!--          v-model="queryParams.storebangdingid"-->
    <!--          placeholder="请输入店铺绑定ID"-->
    <!--          clearable-->
    <!--          @keyup.enter.native="handleQuery"-->
    <!--        />-->
    <!--      </el-form-item>-->
    <!--      <el-form-item label="价格增加" prop="priceIncrease">-->
    <!--        <el-input-->
    <!--          v-model="queryParams.priceIncrease"-->
    <!--          placeholder="请输入价格增加"-->
    <!--          clearable-->
    <!--          @keyup.enter.native="handleQuery"-->
    <!--        />-->
    <!--      </el-form-item>-->
    <!--      <el-form-item label="API价格增加1" prop="apipriceIncrease1">-->
    <!--        <el-input-->
    <!--          v-model="queryParams.apipriceIncrease1"-->
    <!--          placeholder="请输入API价格增加1"-->
    <!--          clearable-->
    <!--          @keyup.enter.native="handleQuery"-->
    <!--        />-->
    <!--      </el-form-item>-->
    <!--      <el-form-item label="API价格增加2" prop="apipriceIncrease2">-->
    <!--        <el-input-->
    <!--          v-model="queryParams.apipriceIncrease2"-->
    <!--          placeholder="请输入API价格增加2"-->
    <!--          clearable-->
    <!--          @keyup.enter.native="handleQuery"-->
    <!--        />-->
    <!--      </el-form-item>-->
    <!--      <el-form-item label="顶级电话数量" prop="istoptelcount">-->
    <!--        <el-input-->
    <!--          v-model="queryParams.istoptelcount"-->
    <!--          placeholder="请输入顶级电话数量"-->
    <!--          clearable-->
    <!--          @keyup.enter.native="handleQuery"-->
    <!--        />-->
    <!--      </el-form-item>-->
    <!--      <el-form-item label="顶级处方时间" prop="istopprescriptiontime">-->
    <!--        <el-input-->
    <!--          v-model="queryParams.istopprescriptiontime"-->
    <!--          placeholder="请输入顶级处方时间"-->
    <!--          clearable-->
    <!--          @keyup.enter.native="handleQuery"-->
    <!--        />-->
    <!--      </el-form-item>-->
    <!--      <el-form-item label="添加店铺数量" prop="addstorecount">-->
    <!--        <el-input-->
    <!--          v-model="queryParams.addstorecount"-->
    <!--          placeholder="请输入添加店铺数量"-->
    <!--          clearable-->
    <!--          @keyup.enter.native="handleQuery"-->
    <!--        />-->
    <!--      </el-form-item>-->
    <!--      <el-form-item label="手机靓号店铺ID" prop="sjlhstoreid">-->
    <!--        <el-input-->
    <!--          v-model="queryParams.sjlhstoreid"-->
    <!--          placeholder="请输入手机靓号店铺ID"-->
    <!--          clearable-->
    <!--          @keyup.enter.native="handleQuery"-->
    <!--        />-->
    <!--      </el-form-item>-->
    <!--      <el-form-item label="号码库店铺ID" prop="hmkstoreid">-->
    <!--        <el-input-->
    <!--          v-model="queryParams.hmkstoreid"-->
    <!--          placeholder="请输入号码库店铺ID"-->
    <!--          clearable-->
    <!--          @keyup.enter.native="handleQuery"-->
    <!--        />-->
    <!--      </el-form-item>-->
    <!--      <el-form-item label="手机靓号附加名称" prop="sjlhadditionalname">-->
    <!--        <el-input-->
    <!--          v-model="queryParams.sjlhadditionalname"-->
    <!--          placeholder="请输入手机靓号附加名称"-->
    <!--          clearable-->
    <!--          @keyup.enter.native="handleQuery"-->
    <!--        />-->
    <!--      </el-form-item>-->
    <!--      <el-form-item label="号码库附加名称" prop="hmkadditionalname">-->
    <!--        <el-input-->
    <!--          v-model="queryParams.hmkadditionalname"-->
    <!--          placeholder="请输入号码库附加名称"-->
    <!--          clearable-->
    <!--          @keyup.enter.native="handleQuery"-->
    <!--        />-->
    <!--      </el-form-item>-->
    <!--      <el-form-item label="抖店订单业务ID" prop="doudianOrderBusinessId">-->
    <!--        <el-input-->
    <!--          v-model="queryParams.doudianOrderBusinessId"-->
    <!--          placeholder="请输入抖店订单业务ID"-->
    <!--          clearable-->
    <!--          @keyup.enter.native="handleQuery"-->
    <!--        />-->
    <!--      </el-form-item>-->
    <!--      <el-form-item>-->
    <!--        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>-->
    <!--        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>-->
    <!--      </el-form-item>-->
    <!--    </el-form>-->

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['hmk:systemConfig:add']"
        >新增
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['hmk:systemConfig:edit']"
        >修改
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['hmk:systemConfig:remove']"
        >删除
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['hmk:systemConfig:export']"
        >导出
        </el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="systemConfigList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center"/>
      <el-table-column label="主键" align="center" prop="id"/>
      <el-table-column label="名称" align="center" prop="name"/>
      <el-table-column label="工作描述" align="center" prop="job"/>
      <el-table-column label="电话" align="center" prop="tel"/>
      <el-table-column label="版权信息" align="center" prop="banquan"/>
      <el-table-column label="备案信息" align="center" prop="beian"/>
      <el-table-column label="关键词" align="center" prop="keywords"/>
      <el-table-column label="描述" align="center" prop="description"/>
      <el-table-column label="PC端代码" align="center" prop="pcdaima"/>
      <el-table-column label="移动端代码" align="center" prop="mobiledaima"/>
      <el-table-column label="杀号数量" align="center" prop="killcount"/>
      <el-table-column label="说明" align="center" prop="shuoming"/>
      <el-table-column label="是否废弃" align="center" prop="abandoning"/>
      <el-table-column label="订单超时时间" align="center" prop="orderovertime"/>
      <el-table-column label="支付时间" align="center" prop="paytime"/>
      <el-table-column label="休息天数" align="center" prop="xuiutian"/>
      <el-table-column label="URL代码" align="center" prop="urldaima"/>
      <el-table-column label="最小价格" align="center" prop="minprices"/>
      <el-table-column label="最大价格" align="center" prop="maxprices"/>
      <el-table-column label="最小价格" align="center" prop="minprice"/>
      <el-table-column label="最大价格" align="center" prop="maxprice"/>
      <el-table-column label="佣金阈值" align="center" prop="commissionThreshold"/>
      <el-table-column label="用户优惠券" align="center" prop="usercoupons"/>
      <el-table-column label="用户优惠券万" align="center" prop="usercouponswan"/>
      <el-table-column label="订单状态1" align="center" prop="orderstate1"/>
      <el-table-column label="订单状态2" align="center" prop="orderstate2"/>
      <el-table-column label="订单状态3" align="center" prop="orderstate3"/>
      <el-table-column label="订单状态4" align="center" prop="orderstate4"/>
      <el-table-column label="订单状态5" align="center" prop="orderstate5"/>
      <el-table-column label="订单状态6" align="center" prop="orderstate6"/>
      <el-table-column label="订单状态7" align="center" prop="orderstate7"/>
      <el-table-column label="订单状态8" align="center" prop="orderstate8"/>
      <el-table-column label="订单状态9" align="center" prop="orderstate9"/>
      <el-table-column label="内容API Key" align="center" prop="contentapik"/>
      <el-table-column label="电话号码段4" align="center" prop="telhaoduan4"/>
      <el-table-column label="搜索关键词1" align="center" prop="searchkeywords1"/>
      <el-table-column label="搜索关键词2" align="center" prop="searchkeywords2"/>
      <el-table-column label="供应商数组" align="center" prop="arrSupplier"/>
      <el-table-column label="客服URL" align="center" prop="kefuurl"/>
      <el-table-column label="店铺绑定ID" align="center" prop="storebangdingid"/>
      <el-table-column label="订单URL" align="center" prop="orderkurl"/>
      <el-table-column label="价格增加" align="center" prop="priceIncrease"/>
      <el-table-column label="API价格增加1" align="center" prop="apipriceIncrease1"/>
      <el-table-column label="API价格增加2" align="center" prop="apipriceIncrease2"/>
      <el-table-column label="顶级电话数量" align="center" prop="istoptelcount"/>
      <el-table-column label="顶级处方时间" align="center" prop="istopprescriptiontime"/>
      <el-table-column label="添加店铺数量" align="center" prop="addstorecount"/>
      <el-table-column label="手机靓号店铺ID" align="center" prop="sjlhstoreid"/>
      <el-table-column label="号码库店铺ID" align="center" prop="hmkstoreid"/>
      <el-table-column label="手机靓号附加名称" align="center" prop="sjlhadditionalname"/>
      <el-table-column label="手机靓号附加信息" align="center" prop="sjlhadditional"/>
      <el-table-column label="号码库附加名称" align="center" prop="hmkadditionalname"/>
      <el-table-column label="号码库附加信息" align="center" prop="hmkadditional"/>
      <el-table-column label="抖店订单业务ID" align="center" prop="doudianOrderBusinessId"/>
      <el-table-column label="订单失败类型" align="center" prop="orderFailType"/>
      <el-table-column label="订单取消类型" align="center" prop="orderCancelType"/>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['hmk:systemConfig:edit']"
          >修改
          </el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['hmk:systemConfig:remove']"
          >删除
          </el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改系统配置对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="名称" prop="name">
          <el-input v-model="form.name" placeholder="请输入名称"/>
        </el-form-item>
        <el-form-item label="工作描述" prop="job">
          <el-input v-model="form.job" placeholder="请输入工作描述"/>
        </el-form-item>
        <el-form-item label="电话" prop="tel">
          <el-input v-model="form.tel" placeholder="请输入电话"/>
        </el-form-item>
        <el-form-item label="版权信息" prop="banquan">
          <el-input v-model="form.banquan" placeholder="请输入版权信息"/>
        </el-form-item>
        <el-form-item label="备案信息" prop="beian">
          <el-input v-model="form.beian" placeholder="请输入备案信息"/>
        </el-form-item>
        <el-form-item label="关键词" prop="keywords">
          <el-input v-model="form.keywords" type="textarea" placeholder="请输入内容"/>
        </el-form-item>
        <el-form-item label="描述" prop="description">
          <el-input v-model="form.description" type="textarea" placeholder="请输入内容"/>
        </el-form-item>
        <el-form-item label="PC端代码" prop="pcdaima">
          <el-input v-model="form.pcdaima" type="textarea" placeholder="请输入内容"/>
        </el-form-item>
        <el-form-item label="移动端代码" prop="mobiledaima">
          <el-input v-model="form.mobiledaima" type="textarea" placeholder="请输入内容"/>
        </el-form-item>
        <el-form-item label="杀号数量" prop="killcount">
          <el-input v-model="form.killcount" placeholder="请输入杀号数量"/>
        </el-form-item>
        <el-form-item label="说明" prop="shuoming">
          <el-input v-model="form.shuoming" type="textarea" placeholder="请输入内容"/>
        </el-form-item>
        <el-form-item label="是否废弃" prop="abandoning">
          <el-input v-model="form.abandoning" placeholder="请输入是否废弃"/>
        </el-form-item>
        <el-form-item label="订单超时时间" prop="orderovertime">
          <el-input v-model="form.orderovertime" placeholder="请输入订单超时时间"/>
        </el-form-item>
        <el-form-item label="支付时间" prop="paytime">
          <el-input v-model="form.paytime" placeholder="请输入支付时间"/>
        </el-form-item>
        <el-form-item label="休息天数" prop="xuiutian">
          <el-input v-model="form.xuiutian" placeholder="请输入休息天数"/>
        </el-form-item>
        <el-form-item label="URL代码" prop="urldaima">
          <el-input v-model="form.urldaima" type="textarea" placeholder="请输入内容"/>
        </el-form-item>
        <el-form-item label="最小价格" prop="minprices">
          <el-input v-model="form.minprices" placeholder="请输入最小价格"/>
        </el-form-item>
        <el-form-item label="最大价格" prop="maxprices">
          <el-input v-model="form.maxprices" placeholder="请输入最大价格"/>
        </el-form-item>
        <el-form-item label="最小价格" prop="minprice">
          <el-input v-model="form.minprice" placeholder="请输入最小价格"/>
        </el-form-item>
        <el-form-item label="最大价格" prop="maxprice">
          <el-input v-model="form.maxprice" placeholder="请输入最大价格"/>
        </el-form-item>
        <el-form-item label="佣金阈值" prop="commissionThreshold">
          <el-input v-model="form.commissionThreshold" placeholder="请输入佣金阈值"/>
        </el-form-item>
        <el-form-item label="用户优惠券" prop="usercoupons">
          <el-input v-model="form.usercoupons" placeholder="请输入用户优惠券"/>
        </el-form-item>
        <el-form-item label="用户优惠券万" prop="usercouponswan">
          <el-input v-model="form.usercouponswan" placeholder="请输入用户优惠券万"/>
        </el-form-item>
        <el-form-item label="订单状态1" prop="orderstate1">
          <el-input v-model="form.orderstate1" type="textarea" placeholder="请输入内容"/>
        </el-form-item>
        <el-form-item label="订单状态2" prop="orderstate2">
          <el-input v-model="form.orderstate2" type="textarea" placeholder="请输入内容"/>
        </el-form-item>
        <el-form-item label="订单状态3" prop="orderstate3">
          <el-input v-model="form.orderstate3" type="textarea" placeholder="请输入内容"/>
        </el-form-item>
        <el-form-item label="订单状态4" prop="orderstate4">
          <el-input v-model="form.orderstate4" type="textarea" placeholder="请输入内容"/>
        </el-form-item>
        <el-form-item label="订单状态5" prop="orderstate5">
          <el-input v-model="form.orderstate5" type="textarea" placeholder="请输入内容"/>
        </el-form-item>
        <el-form-item label="订单状态6" prop="orderstate6">
          <el-input v-model="form.orderstate6" type="textarea" placeholder="请输入内容"/>
        </el-form-item>
        <el-form-item label="订单状态7" prop="orderstate7">
          <el-input v-model="form.orderstate7" type="textarea" placeholder="请输入内容"/>
        </el-form-item>
        <el-form-item label="订单状态8" prop="orderstate8">
          <el-input v-model="form.orderstate8" type="textarea" placeholder="请输入内容"/>
        </el-form-item>
        <el-form-item label="订单状态9" prop="orderstate9">
          <el-input v-model="form.orderstate9" type="textarea" placeholder="请输入内容"/>
        </el-form-item>
        <el-form-item label="内容API Key" prop="contentapik">
          <el-input v-model="form.contentapik" type="textarea" placeholder="请输入内容"/>
        </el-form-item>
        <el-form-item label="电话号码段4" prop="telhaoduan4">
          <el-input v-model="form.telhaoduan4" type="textarea" placeholder="请输入内容"/>
        </el-form-item>
        <el-form-item label="搜索关键词1" prop="searchkeywords1">
          <el-input v-model="form.searchkeywords1" type="textarea" placeholder="请输入内容"/>
        </el-form-item>
        <el-form-item label="搜索关键词2" prop="searchkeywords2">
          <el-input v-model="form.searchkeywords2" type="textarea" placeholder="请输入内容"/>
        </el-form-item>
        <el-form-item label="供应商数组" prop="arrSupplier">
          <el-input v-model="form.arrSupplier" type="textarea" placeholder="请输入内容"/>
        </el-form-item>
        <el-form-item label="客服URL" prop="kefuurl">
          <el-input v-model="form.kefuurl" type="textarea" placeholder="请输入内容"/>
        </el-form-item>
        <el-form-item label="店铺绑定ID" prop="storebangdingid">
          <el-input v-model="form.storebangdingid" placeholder="请输入店铺绑定ID"/>
        </el-form-item>
        <el-form-item label="订单URL" prop="orderkurl">
          <el-input v-model="form.orderkurl" type="textarea" placeholder="请输入内容"/>
        </el-form-item>
        <el-form-item label="价格增加" prop="priceIncrease">
          <el-input v-model="form.priceIncrease" placeholder="请输入价格增加"/>
        </el-form-item>
        <el-form-item label="API价格增加1" prop="apipriceIncrease1">
          <el-input v-model="form.apipriceIncrease1" placeholder="请输入API价格增加1"/>
        </el-form-item>
        <el-form-item label="API价格增加2" prop="apipriceIncrease2">
          <el-input v-model="form.apipriceIncrease2" placeholder="请输入API价格增加2"/>
        </el-form-item>
        <el-form-item label="顶级电话数量" prop="istoptelcount">
          <el-input v-model="form.istoptelcount" placeholder="请输入顶级电话数量"/>
        </el-form-item>
        <el-form-item label="顶级处方时间" prop="istopprescriptiontime">
          <el-input v-model="form.istopprescriptiontime" placeholder="请输入顶级处方时间"/>
        </el-form-item>
        <el-form-item label="添加店铺数量" prop="addstorecount">
          <el-input v-model="form.addstorecount" placeholder="请输入添加店铺数量"/>
        </el-form-item>
        <el-form-item label="手机靓号店铺ID" prop="sjlhstoreid">
          <el-input v-model="form.sjlhstoreid" placeholder="请输入手机靓号店铺ID"/>
        </el-form-item>
        <el-form-item label="号码库店铺ID" prop="hmkstoreid">
          <el-input v-model="form.hmkstoreid" placeholder="请输入号码库店铺ID"/>
        </el-form-item>
        <el-form-item label="手机靓号附加名称" prop="sjlhadditionalname">
          <el-input v-model="form.sjlhadditionalname" placeholder="请输入手机靓号附加名称"/>
        </el-form-item>
        <el-form-item label="手机靓号附加信息" prop="sjlhadditional">
          <el-input v-model="form.sjlhadditional" type="textarea" placeholder="请输入内容"/>
        </el-form-item>
        <el-form-item label="号码库附加名称" prop="hmkadditionalname">
          <el-input v-model="form.hmkadditionalname" placeholder="请输入号码库附加名称"/>
        </el-form-item>
        <el-form-item label="号码库附加信息" prop="hmkadditional">
          <el-input v-model="form.hmkadditional" type="textarea" placeholder="请输入内容"/>
        </el-form-item>
        <el-form-item label="抖店订单业务ID" prop="doudianOrderBusinessId">
          <el-input v-model="form.doudianOrderBusinessId" placeholder="请输入抖店订单业务ID"/>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {
  addSystemConfig,
  delSystemConfig,
  getSystemConfig,
  listSystemConfig,
  updateSystemConfig
} from "@/api/hmk/systemConfig";

export default {
  name: "SystemConfig",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 系统配置表格数据
      systemConfigList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        name: null,
        job: null,
        tel: null,
        banquan: null,
        beian: null,
        keywords: null,
        description: null,
        pcdaima: null,
        mobiledaima: null,
        killcount: null,
        shuoming: null,
        abandoning: null,
        orderovertime: null,
        paytime: null,
        xuiutian: null,
        urldaima: null,
        minprices: null,
        maxprices: null,
        minprice: null,
        maxprice: null,
        commissionThreshold: null,
        usercoupons: null,
        usercouponswan: null,
        orderstate1: null,
        orderstate2: null,
        orderstate3: null,
        orderstate4: null,
        orderstate5: null,
        orderstate6: null,
        orderstate7: null,
        orderstate8: null,
        orderstate9: null,
        contentapik: null,
        telhaoduan4: null,
        searchkeywords1: null,
        searchkeywords2: null,
        arrSupplier: null,
        kefuurl: null,
        storebangdingid: null,
        orderkurl: null,
        priceIncrease: null,
        apipriceIncrease1: null,
        apipriceIncrease2: null,
        istoptelcount: null,
        istopprescriptiontime: null,
        addstorecount: null,
        sjlhstoreid: null,
        hmkstoreid: null,
        sjlhadditionalname: null,
        sjlhadditional: null,
        hmkadditionalname: null,
        hmkadditional: null,
        doudianOrderBusinessId: null,
        orderFailType: null,
        orderCancelType: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        name: [
          {required: true, message: "名称不能为空", trigger: "blur"}
        ],
        job: [
          {required: true, message: "工作描述不能为空", trigger: "blur"}
        ],
        tel: [
          {required: true, message: "电话不能为空", trigger: "blur"}
        ],
        banquan: [
          {required: true, message: "版权信息不能为空", trigger: "blur"}
        ],
        beian: [
          {required: true, message: "备案信息不能为空", trigger: "blur"}
        ],
        keywords: [
          {required: true, message: "关键词不能为空", trigger: "blur"}
        ],
        description: [
          {required: true, message: "描述不能为空", trigger: "blur"}
        ],
        pcdaima: [
          {required: true, message: "PC端代码不能为空", trigger: "blur"}
        ],
        mobiledaima: [
          {required: true, message: "移动端代码不能为空", trigger: "blur"}
        ],
        killcount: [
          {required: true, message: "杀号数量不能为空", trigger: "blur"}
        ],
        shuoming: [
          {required: true, message: "说明不能为空", trigger: "blur"}
        ],
        abandoning: [
          {required: true, message: "是否废弃不能为空", trigger: "blur"}
        ],
        orderovertime: [
          {required: true, message: "订单超时时间不能为空", trigger: "blur"}
        ],
        paytime: [
          {required: true, message: "支付时间不能为空", trigger: "blur"}
        ],
        xuiutian: [
          {required: true, message: "休息天数不能为空", trigger: "blur"}
        ],
        urldaima: [
          {required: true, message: "URL代码不能为空", trigger: "blur"}
        ],
        minprices: [
          {required: true, message: "最小价格不能为空", trigger: "blur"}
        ],
        maxprices: [
          {required: true, message: "最大价格不能为空", trigger: "blur"}
        ],
        minprice: [
          {required: true, message: "最小价格不能为空", trigger: "blur"}
        ],
        maxprice: [
          {required: true, message: "最大价格不能为空", trigger: "blur"}
        ],
        commissionThreshold: [
          {required: true, message: "佣金阈值不能为空", trigger: "blur"}
        ],
        usercoupons: [
          {required: true, message: "用户优惠券不能为空", trigger: "blur"}
        ],
        usercouponswan: [
          {required: true, message: "用户优惠券万不能为空", trigger: "blur"}
        ],
        orderstate1: [
          {required: true, message: "订单状态1不能为空", trigger: "blur"}
        ],
        orderstate2: [
          {required: true, message: "订单状态2不能为空", trigger: "blur"}
        ],
        orderstate3: [
          {required: true, message: "订单状态3不能为空", trigger: "blur"}
        ],
        orderstate4: [
          {required: true, message: "订单状态4不能为空", trigger: "blur"}
        ],
        orderstate5: [
          {required: true, message: "订单状态5不能为空", trigger: "blur"}
        ],
        orderstate6: [
          {required: true, message: "订单状态6不能为空", trigger: "blur"}
        ],
        orderstate7: [
          {required: true, message: "订单状态7不能为空", trigger: "blur"}
        ],
        orderstate8: [
          {required: true, message: "订单状态8不能为空", trigger: "blur"}
        ],
        orderstate9: [
          {required: true, message: "订单状态9不能为空", trigger: "blur"}
        ],
        contentapik: [
          {required: true, message: "内容API Key不能为空", trigger: "blur"}
        ],
        telhaoduan4: [
          {required: true, message: "电话号码段4不能为空", trigger: "blur"}
        ],
        searchkeywords1: [
          {required: true, message: "搜索关键词1不能为空", trigger: "blur"}
        ],
        searchkeywords2: [
          {required: true, message: "搜索关键词2不能为空", trigger: "blur"}
        ],
        arrSupplier: [
          {required: true, message: "供应商数组不能为空", trigger: "blur"}
        ],
        kefuurl: [
          {required: true, message: "客服URL不能为空", trigger: "blur"}
        ],
        storebangdingid: [
          {required: true, message: "店铺绑定ID不能为空", trigger: "blur"}
        ],
        orderkurl: [
          {required: true, message: "订单URL不能为空", trigger: "blur"}
        ],
        priceIncrease: [
          {required: true, message: "价格增加不能为空", trigger: "blur"}
        ],
        apipriceIncrease1: [
          {required: true, message: "API价格增加1不能为空", trigger: "blur"}
        ],
        apipriceIncrease2: [
          {required: true, message: "API价格增加2不能为空", trigger: "blur"}
        ],
        istoptelcount: [
          {required: true, message: "顶级电话数量不能为空", trigger: "blur"}
        ],
        istopprescriptiontime: [
          {required: true, message: "顶级处方时间不能为空", trigger: "blur"}
        ],
        addstorecount: [
          {required: true, message: "添加店铺数量不能为空", trigger: "blur"}
        ],
        sjlhstoreid: [
          {required: true, message: "手机靓号店铺ID不能为空", trigger: "blur"}
        ],
        hmkstoreid: [
          {required: true, message: "号码库店铺ID不能为空", trigger: "blur"}
        ],
        sjlhadditionalname: [
          {required: true, message: "手机靓号附加名称不能为空", trigger: "blur"}
        ],
        sjlhadditional: [
          {required: true, message: "手机靓号附加信息不能为空", trigger: "blur"}
        ],
        hmkadditionalname: [
          {required: true, message: "号码库附加名称不能为空", trigger: "blur"}
        ],
        hmkadditional: [
          {required: true, message: "号码库附加信息不能为空", trigger: "blur"}
        ],
        doudianOrderBusinessId: [
          {required: true, message: "抖店订单业务ID不能为空", trigger: "blur"}
        ],
        orderFailType: [
          {required: true, message: "订单失败类型不能为空", trigger: "change"}
        ],
        orderCancelType: [
          {required: true, message: "订单取消类型不能为空", trigger: "change"}
        ]
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询系统配置列表 */
    getList() {
      this.loading = true;
      listSystemConfig(this.queryParams).then(response => {
        this.systemConfigList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        name: null,
        job: null,
        tel: null,
        banquan: null,
        beian: null,
        keywords: null,
        description: null,
        pcdaima: null,
        mobiledaima: null,
        killcount: null,
        shuoming: null,
        abandoning: null,
        orderovertime: null,
        paytime: null,
        xuiutian: null,
        urldaima: null,
        minprices: null,
        maxprices: null,
        minprice: null,
        maxprice: null,
        commissionThreshold: null,
        usercoupons: null,
        usercouponswan: null,
        orderstate1: null,
        orderstate2: null,
        orderstate3: null,
        orderstate4: null,
        orderstate5: null,
        orderstate6: null,
        orderstate7: null,
        orderstate8: null,
        orderstate9: null,
        contentapik: null,
        telhaoduan4: null,
        searchkeywords1: null,
        searchkeywords2: null,
        arrSupplier: null,
        kefuurl: null,
        storebangdingid: null,
        orderkurl: null,
        priceIncrease: null,
        apipriceIncrease1: null,
        apipriceIncrease2: null,
        istoptelcount: null,
        istopprescriptiontime: null,
        addstorecount: null,
        sjlhstoreid: null,
        hmkstoreid: null,
        sjlhadditionalname: null,
        sjlhadditional: null,
        hmkadditionalname: null,
        hmkadditional: null,
        doudianOrderBusinessId: null,
        orderFailType: null,
        orderCancelType: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加系统配置";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getSystemConfig(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改系统配置";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateSystemConfig(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addSystemConfig(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除系统配置编号为"' + ids + '"的数据项？').then(function () {
        return delSystemConfig(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {
      });
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('hmk/systemConfig/export', {
        ...this.queryParams
      }, `systemConfig_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
